<template>
  <component :is="componentName" />
</template>

<script setup lang="ts">
import Home from '@/view/home/Home.vue'
import Login from '@/view/login/Login.vue'
import Error from '@/view/error/Error.vue';

import { computed } from 'vue';
import { useRoute } from 'vue-router'

const route = useRoute()
const componentName = computed(() => {
    console.log('route', route, route.fullPath, route.fullPath !== '/login')
    if (route.fullPath === '/error') {
        return Error
    } else if (route.fullPath === '/login') {
        return Login
    } else {
        return Home
    }
})



</script>

<style lang="less" scoped>

</style>
